import api from './index'

// 认证相关API
export const authAPI = {
  // 管理员登录
  adminLogin: (credentials) => {
    return api.post('/auth/admin/login', credentials)
  },

  // 学生登录
  studentLogin: (credentials) => {
    return api.post('/auth/student/login', credentials)
  },

  // 登出
  logout: () => {
    return api.post('/auth/logout')
  },

  // 刷新token
  refreshToken: () => {
    return api.post('/auth/refresh')
  },

  // 修改密码
  changePassword: (data) => {
    return api.post('/auth/change-password', data)
  },

  // 获取用户信息
  getUserInfo: () => {
    return api.get('/auth/user-info')
  }
}